package com.gxc.entity;

import java.io.Serializable;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

/**
 * ES实体类.
 *
 * @author 宫新程
 * @since 2019/1/17 11:01 AM
 */
@Data
@Document(indexName = "gxc_article", type = "article")
public class Article implements Serializable {

  @Id private String id;

  /**
   * index：
   *  是否索引，该域是否能被搜索
   *  是否分词，表示搜索的时候是整体匹配还是分词
   *  是否存储，是否在页面上显示.
   */
  @Field(analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
  private String title;

  @Field(analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
  private String content;

  private String state; // 审核状态
}
